<?php
      if (isset($_REQUEST["gender"]))  {
		$gender=$_REQUEST["gender"];
	  	$age=$_REQUEST["age"]; 
		if(isset($_REQUEST["gift"])) {
			$gift="yes"; 
		}
		else { 
		      $gift="no";
		}
 		$pris=500;
		
		if ($gender=="male" && $age<=24 && $gift=="no") { 
			$pris=$pris+1500;
      	}
        if ($gender=="female") { 
			$pris=$pris-200;
      	}
	    if ($gender=="male" && $gift=="yes") { 
			$pris=$pris-200;
	  	}
	    if ($age>=46 && $age<=64) { 
			$pris=$pris-100;
		}
		echo $pris;
	} 
?>

<form action=forsikringsberegner2.php>

<table>    <input type="radio" value="male" name="gender" checked="checked" /> Male <BR />
<table>    <input type="radio" value="female" name="gender" /> Female <BR />
    Age: <select name="age">
    <?php
		for($a=16; $a<=80; $a++) {
		echo "<option value=$a> $a </option>";
		}
?>		
    </select>
    <input type="checkbox" name="gift" /> Gift <BR />
    <input type="submit" />
    
</form>